package cc.rengu.oltp.service.common.enums;

/**
 * 支付方式枚举
 * Created by wangc on 2020/7/27.
 */
public enum PayTypeEnum {
    BANK_CARD("00", "本行卡支付"),
    OTHER_BANK_CARD("01", "他行卡支付"),
    WECHAT("02", "微信支付"),
    ALIPAY("03", "支付宝支付"),
    CUPS_CLOUD("04", "银联云闪付"),
    STAGE("05", "分期支付"),
    SCORE("06", "积分支付"),
    COUPON("07", "优惠券支付"),
    RED_PACKET("08", "红包支付"),
    WALLET("09", "钱包支付"),
    OTHER("*", "其它支付方式"),
    ;
    private String payType;
    private String payDesc;

    PayTypeEnum(String payType, String payDesc) {
        this.payType = payType;
        this.payDesc = payDesc;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getPayDesc() {
        return payDesc;
    }

    public void setPayDesc(String payDesc) {
        this.payDesc = payDesc;
    }

    /**
     * 根据支付类型查询描述
     *
     * @param payType 支付类型
     * @return 账户类型描述
     */
    public static String getPayTypeDesc(String payType) {
        for (PayTypeEnum payTypeEnum : PayTypeEnum.values()) {
            if (payTypeEnum.getPayType().equals(payType)) {
                return payTypeEnum.getPayDesc();
            }
        }
        return null;
    }
}
